import { Component } from '@angular/core';
import { IonicPage, NavController, NavParams } from 'ionic-angular';
import { APP_YUANCHNEG_URL } from '../../providers/Constants';
import {HttpService} from '../../providers/HttpService';
import { TabsPage } from "../tabs/tabs";


@IonicPage()
@Component({
  selector: 'page-login',
  templateUrl: 'login.html',
})
export class LoginPage {
    pass="";
    user="";
    appimg: string = './assets/imgs/app.png';//用户默认头像
    zhang: string = './assets/imgs/zhang.png';
    mi: string = './assets/imgs/mi.png';
  constructor(public navCtrl: NavController, public navParams: NavParams,private httpService: HttpService) {

  }

  
  logIn() {
       
        
        let OBJ={
            username:this.user,
            password:this.pass
        };
       
        this.httpService.post(APP_YUANCHNEG_URL+'/api/sys/account/signIn',OBJ).then(res=>{
                //console.log(res);
                if(res.code=="111"){

                   this.navCtrl.push(TabsPage,{
                    data:res
                   });
                }else{
                    alert(res.msg); 
                }
                
            
        });
    }

}
